#!/bin/csh -f
# The Party Program--Invitations to friends from the "guest" file 
#set guestfile = ~/shell/guests
set guestfile = ./guests
if ( ! -e "$guestfile" ) then
	echo "$guestfile:t non-existent"
	exit 1
endif
setenv PLACE "Sarotini's"
@ Time = `date +%H` + 1
set food = ( cheese crackers shrimp drinks "hot dogs" sandwiches )
foreach person ( `cat $guestfile` )
if ( $person =~ root ) continue
mail -v -s "Party" $person << FINIS   # Start of here document
Hi $person! Please join me at $PLACE for a party! 
Meet me at $Time o'clock.
I'll bring the ice cream. Would you please bring $food[1] and 
anything else you would like to eat? Let me know if you can 
make it. Hope to see you soon.
	Your pal,
	ellie@`hostname`       # or `uname -n`

FINIS
shift food
if ( $#food ==  0 ) then
	set food = ( cheese crackers shrimp drinks "hot dogs" 
	             sandwiches )
endif
end
		
echo "Bye..." 
